<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script></script>
  </head>
  <body>
    <button class="send">发送</button>
  </body>
  <script>
    let btn = document.querySelector(".send");
    btn.onclick = function () {
      let script = document.createElement("script");
      script.src = "http://localhost:8000";
      document.body.appendChild(script);
      console.log(1);
    };
    // 将数据封装在服务端的函数中 客户端定义一个函数 返回之后 执行这个函数就可以获得包裹的数据
    function getData(res) {
      console.log(res);
    }
  </script>
</html>
